//
//  MyWaterFLow.h
//  iphoneApp
//
//  Created by Liyu on 12-11-6.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MyImageView.h"


@class MyWaterFLow;

@protocol MyWaterFlowDataSource<NSObject>

@required
-(NSInteger) numberOfImageInWaterFlow :(MyWaterFLow *) waterflow;

-(NSInteger)waterflow:(MyWaterFLow *) waterflow heightForImageAtIndex:(NSInteger)index;

-(MyImageView *)waterflow:(MyWaterFLow *) waterflow imageViewForWaterFlowAtIndex:(NSInteger) index;


@end

@protocol MyWaterFlowDelegate<NSObject>
@optional
-(void) myWaterFlowDidScroll :(MyWaterFLow *) waterflow;
@end


@interface MyWaterFLow:UIScrollView <UIScrollViewDelegate>
{
    NSMutableArray * columnHeightArr;
    
    id<MyWaterFlowDelegate> _waterFlowDelegate;
    
    id<MyWaterFlowDataSource> _dataSource;
    
    NSInteger _pageIndex;
    
    CGFloat _columnWidth;
    
}

@property(nonatomic,readonly,retain) NSMutableArray * columnHeightArr;
@property(nonatomic,assign) CGFloat ColumnWidth;
@property(nonatomic,assign) NSInteger pageIndex;
@property(nonatomic,assign) id<MyWaterFlowDataSource> dataSource;
@property(nonatomic,assign) id<MyWaterFlowDelegate> mywaterFlowDelegate;

-(NSInteger) getMaxHeightColumnIndexInArray;
-(void)LoadWaterFlow;

@end


